<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<header th:replace="admin/header::header-fragment">
</header>
<body>
<shiro:user>
<div class="layui-form" lay-filter="layuiadmin-form-role" id="layuiadmin-form-role" style="padding: 20px 30px 0 0;">
    <div class="layui-form-item">
        <label class="layui-form-label">后台用户</label>
        <div class="layui-input-block">
            <select name="roleUsername">
                <option th:each="adminUser:${adminUsers}" th:value="${adminUser.getBlogUserId()}" th:text="${adminUser.getBlogUsername()}"></option>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">角色</label>
        <div class="layui-input-block">
            <select name="rolejuese">
                <option th:each="role:${roles}" th:value="${role.roleId}" th:text="${role.roleName}"></option>
            </select>
        </div>
    </div>
    <div class="layui-form-item layui-hide">
        <button class="layui-btn" lay-submit lay-filter="LAY-user-role-submit" id="LAY-user-role-submit">提交</button>
    </div>
</div>
</shiro:user>
<shiro:guest>
    <footer th:replace="admin/nologin::header-fragment">
    </footer>
</shiro:guest>
<script th:src="@{/layuiadmin/layui/layui.js}"></script>
<script>
    layui.config({
        base: 'layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form'], function(){
        var $ = layui.$
            ,form = layui.form ;
        //监听提交
        form.on('submit(LAY-user-role-submit)', function(data){
            alert(JSON.stringify(data));
        });


    })
</script>
</body>
</html>